UPDATE: better criteria for if statements.