generate Random functionality