Add ranking code