got ride of extra print statements and added some comments
merged Eric's and my code