Updated clear array method