updated to show number of loops