lean optimize summary and by-of-summary
docstring for _lean
lean optimize on sort