moved search.py to metric.py