SOlving problem 83 + tests