change egonet to functions