Added more rand functions and made them static