added circular buffer code for UART com