Array sum method implemented