History rates

nice use of indexBy / keys