beginning of circle detection