Assignment7 submission

A variation of lines 10-14 are repeated multiple times in this file. Consider creating a helper function that encapsulates these lines in order to reduce repetition.