now use open() and write()