added decision engine code