This is the code for my assignment 2