simple implementation, reads in STDIN, outputs STDOUT