if statements to check for direction