new looping method is now working