modified as per the assignment