Simplify.
Integrate tests.
Factorise code to get or pop random items from a list.
Simplify.
Typo.
Prettify formula strings.

Only enclose (sub)formulas in parentheses when necessary.
First step towards predicate logic.
Typo (again).