implement pure-python search routine, and don't use locate