command line loop finding