make out invariant, generate docs