Now calling loop from main, added a visualization method