the code: final add with array