added (untested) parity checking. it definitely has no bugs at all.