Improved documentation and effectivized

addUn() is now faster, and generate.py is more well-documented.