add code to test from sample pattern