Update socket frame and incorporate mergesort (untested)