The used return statement does not modify the array - corrected that