fixes search, adds foundation