problem 16
many improvements to style