Implement much improved merge algorithm