reverted to old way of looping