solved quick sort exercise