Code for generating a tube