Organized code. Added comments.

Just making things pretty.