initial code for assignment 8