Made AI ver D much much faster. Kudos to Jon for the help.