Update to python 3 and fix some formatting