Combined effects of nonmetallic impurities and planned metallic dopants on grain boundary energy and strength