Format and cleanup

Done in github editor... Untested.