hw1 ranker implementation