Fixed typo
Added networking code
Fixed error
Divided code more clearly