finish exercise 6 with tests