More ai tweaks, and cleaingin code a bit