pass by reference to modify original array directly