updated ArrayMath.java