fixed errors, writes to stdout now