Did some packet stuff

Haven't tested it yet but should be working. Only 2 errors to fix now.