why 2 if statements, instead of one?