make random data function simpler