added comments and more reasonable variable names