Add looping/threading structure.