Implementing galloping with functions rather than having massive merge() functions.