code for the assignment finished