write output WIP