math.random was being picked twice for the pattern select instead of using char digit at some location