added a potential optimization for one-direction merges