doc is nearly finished.the quad function may need to be rewritten