python 1resubmit

brought down the program to about 40 lines