added ranking algo and return score to UI