Cleaned Code

Refactored. Reformatted. Restyled existing code.
Added a bunch of comments.
Renamed variables to be more descriptive.