Changed sorting (issue #7)
Added prioroty change (issue #6)