Updates to ai. Adding tests.