Converting pyramid_merge to generic sort function
No need to convert ticks to nanos since I am just comparing