correct task sorting