Finished problem 18

(Will possibly need to move some of the methods of 18 to a public class
for use in other exercises)