starting to implement Mapper.write