Make use of `keys` in `vals` keeping the code DRYer
cache length value
Merge pull request #4 from FWeinb/simplify-vals

Make use of `keys` in `vals` keeping the code DRYer