added predictive lap buffer compacting algo and beginnings of unit test