minor fixes; added random data generation