Working ranking resource allocation
Minor changes