Cleanup
Add some comments; fix indents
Put print statements in the right place