random rating function added