Make condition more specific.
Add comments.
Add test case.
Simplify implementation of "Alt" terms.
Add test cases.
Simplify implementation of "Opt" terms.
Reorder functions.