Adding basic ranking funtion