fixed ranking algorithm