Added Decision calculation code