Quick sorting implemention.