moved count_pattern.py