example script for ring buffer