Finished up to problem 6