refactor QR Class. Add in additional correctness tests.