Correct electron write function

The "deselect" function had to be wrapped with a vector because it takes
multiple arguments now. Flags like "isParticle" had to be defined to
eliminate compiler errors. Now it compiles, it only does not work in that
stage and produces a deadlock.