Quantity experiment

This seems useful. It might well lead to a switch to C++.