the code for assignment 4