rewriting electrode class