add implementation for quick sort