added analytic code