fix for random pattern generation; added random patterns to test scenario