updated loop and a half!