cleaned up variable code; added comments & explanation