Made Troz python3 compatible
Cleaning up code