cleaned up some code. skeleton for discover