Added networking code
Bugfixing with setup