fixed and improved structure of ranking