reimplemented ranker with a more workable interface