Fixes bugs for insertion
Adds Invalidator class