Cleaned up code further.

Cleaned up code further and converted prints and inputs to Python3.