Added dimension parameter to addArray().