adds sortable funcdtion