finished up to problem 8