Added some code for discovering empegs.