In-place array modification