added ranking functionality