got basic pattern search working