Use proper writeArray