fixed up search fxn a bit, still needs more work