AI almost Complete and bug fixes