updated getVal to calcuate index from timestamp and  use an environment as a hash for the cache, updated documentation