Calculation function added, array function modified