Changed code as per assignment 3