works! with bug: 1st time record is dropped, so reset are off by one