made the serial reading accurate
adjusted the flags slightly