almost working line check for AI