- fix writing the arrays