added method for random test generation