search to a given depth