The role of nitrogen in carbon nanotube formation