grouped code into more logical sections
added pragma marks