added a ring buffer for serial reception