more work on search
search non-in-template logic done