Minor changes, implementing write()