added pattern matcher