Added AI, updated a bunch of stuff to work again

Fixed freezing bug