adding loop stuff