Implement mergesort and insertionsort