AI arrive

Adding AI to source code. Fixed bug with wrong matrix dimension. Find
bug in delete func