Changed variable names and added comments