working on loop analysis