Added code to parse incoming bytes