handles sort order by numeric values