algorithms for pattern matching 1804433