Implemented new ray test.