Updated ranking algorithm