Added method to get a random pattern