some fixes + AI!