analytic code added