added all of the code from milestone1