added comments on if statements