No point passing dummy args to existing function, split out logic instead. Also add flush after writing mesh data too.