This is the code for the first CD assignment