fixed template error by moving all monge search code into monge.h