ai collisions algorithm, more smart