Modified code to take the cache file as argument.