Reformatting code and some problem 18 code