adding sort method for tasks