implement delay and cache calculations. still needs a fudge factor for some reason...