assignment 1 part b code
a