sample code to do quick sort