finishes documentation and adds invariant syntax (which doesn't work) and a test stub