Make variable names more descriptive and add comments