Energy gap states and interfacial barriers in amorphous Se and As2Se3