Modified assignment 7 according to the requirements