start of packet parsing (will REALLY need to clean this up, fuck switch/case)