logic to find largest/small array
http://www.java-examples.com/find-largest-and-smallest-number-array-example