Added comments and spaced out code

Comments and spacing inserted to make things substantially more readable.