Add output tracking and goal state.