Finished specification and added some features, as described in GordianSE.