Added checks for direction