add elements-of-type function.