moved output as member of State