precompute everything