Continie debug ai; Refactoring;
Fix not correct calc index by vector; Fix returning max leement instead index of mae element;