Effect of nitrogen doping and hydrogen confinement on the electronic properties of a single walled carbon nanotube