Tracing functions now work properly. Simple AI implmentend.