returns false when b or a occurs 2 steps before the other