Added codes for networking functionality (not yet tested)