test code to cross validate results and find the error