loop now working