added loops finding