Cleanup code.. semi-working AI