add code for assignment 6