Added comments & restructured some code and vars