Add support for multiple packet types and flesh out data packet structure
Change == 0 to === 0 to keep linter happy
Resolve merge conflict