working priority sort and delete methods