Added write functions for array types