Moved the epoch calculation code out of each cadence 'for' loop and created a private function each loop could call