Implementing cached inverting.