if statements and bi-directional bytes

I think in your definition of startbyte you want to initialize it. I'm not sure there's a guarantee that it isn't born with a value 254;