if statements now work properly