adding outputs with write

adding outputs with write