removed some code copied from UART decoder, fixed some Python syntax issues