Added write function that accepts array[4]