Implement of RANSAC