Revised variable names, and added comments