minor changes in discover function