completed algorithm implementation with real notion of an ant