Add endCondition and save additional information