first bash at chain matching