main loop is reading data from serial