Implemented heapsort (non graphical version)