Adding support for sorting