Added initial sorting to tasks