Modified Assignment 7 according to the requirements