first version, python2.6 oriented