implement mergesort algorithm in C