merged existing code into socket

finished socket code and merged bfs function into the socket; made
small changes to ui; removed old code