Added electron selection code