Python3 compatibility

Now it works correct in python 3.3