TODO: implement the quick sorting