updates to ranking function