change codesend to read from stdin