fixed ring buffer:   src/main.c