More docs and unittests; replaced algoFormat with ~