adding cache Inverse R script