fixed data writing for processing, minor mods to processing