resetting variable counter...
Fix the slice state reset to keep refs consistent.
Slicing works.
update test cases