MergeSort added and double buffering to avoid flickering