Made closest beer and closest mines use memoized function