collecting terms is broken
not perfect but it works
Merge pull request #23 from MatthewJA/wip-simplification

Fixes #23.