ranking code in matrix view.