revised variable names added comments