added random lead allocation function