a discrete cache based value function