in middle of modifying saving function for array types