Uart code marginally less buggy