Code for assignment 3 done