changing variable i to inverse_cache in order to make the code more readable