pattern expansion added