The api tweaked so it's fit for Python 3.x (I hope D:)