Network functionality improved, code somewhat dirty now though.