#21 - removed error in buffer calculation; now there is no drop in the graph every period.