The modified script TBDeV with caching, a small optimization