commented code and clarified variables