fixed const-ness in addArray