Edited variables/comments for clarity