Changed variables to private, added extensive code documentation, and general code cleanup