Added comments
Fixed indentation
Changed variable for clarity