Also, when you factor out a method, you should ensure that you only pass in the minimum amount of information required to get the job done. There is no reason to pass the array.length as a parameter to the method. that information is implicit in the array.
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter