adding code for the assignment