Fix bugs in elect.py for re algorithm
Normalize initialization of terms
Save one function call
Make an `if' happen conditionally, so it happens less
Syntax improvement
Syntax performance improvement