Updated to use the new task system