tests changes and ArrWrite optimization