fixed read from stdin
dump to stdout rather than file (should be an option?)