solve problem 19 and tidy documentation