added correctness checker and new method to check r and c