Wrote frequency function and a mergesort over two lists