Making if statements take formula rather than term