added fixrand method to the code base