new stuff from exercism
using Sequence foldrWithIndex