Structural and electronic properties of perfect and defective BN nanoribbons: A DFT study