Implement a cascade cache system to try to speed up calculations.