Add sort and delete function