final version, removed helper stdouts