You can move the `.map` to the definition of `accAmounts` so you don't have to repeat it.

Also, convert the amounts to `double` instead of `int` if possible.