Understanding electronic and optical properties of N–Sn codoped anatase TiO2