adding cache for large input set