making sort optional