implemented ranking