Update great_prod.py

Made it more efficient