Made twoq a template with respect to the elements that it handles.