Changed random generation function
Corrections for friends system