Better network code

Still doesn't work