finish implementing cache management with past data, and fix some bugs of with predicted data