Fixed up python script to be cleaner.