Add test routine for correctness.