Add functionality to sort quotes (with known bug)