Ported code to python 3
Removed useless comments