cleaned up code a little with code headers