forgot to have stdin to stdout in this version, add comments