Liorch88 custom key function

New pull request with changes from #102 from @liorch88