simple implementation of quick sort