Finished assignment 2, problem 1a-f