Cleaned up python src code