Cleaning up code to python standards.