refactored python to a more sane starting point