add indexes
refactor revenue to use reduce