Cleaned up code on problems 1 and 4, finished work on problem 6