more work on writing to kmz