Cleaned up python script and added command line options