Optimization MAX, next --> use caching