Added better AI structure