Update to AI to optimize some of the functions
Merge branch 'master' of github.com:gvsboy/heartbeat

Merging my AI changes.