Few changes to AI ver D. Also added a basic logging system. More dev on that in future.