Made simpleParity a templated function.