updated code for assignment 5