Added heapsort and cleanup header file functions