added quick sort and fixed swap