changed variable names for readability, added comments