added worked examples and sequence extraction logic