moving ideas out of main.c and into uart.c and uart.h