updated ranking algorithm