Cleaned up and added comments to networking parts