adding sort grammar