The electronic structure and grain boundary segregation by boron addition