added test for looping