precompute width