I totally rewrote Chi square delta function for the learning experience of agent. Props!