swapped env and task objects, minor detail