Task sorting by priority and due date