simplification
changed "write" to "output"