Added HeapSort function
Changed Time sync function