Conveted stdlib_mergesort to main_template