Array sum in scala. Please help me with this.