When electrons gain energy they