The extraction of building roof planes from lidar data has become a popular research topic with random sample consensus (RANSAC) being one of the most commonly adopted algorithms. RANSAC extracts full planes, which is problematic when there are other points outside the plane boundary but within the plane space. This study proposes an improved RANSAC (I-RANSAC) algorithm by removing points that do not belong to the roof plane. I-RANSAC selects a random point from the extracted roof plane and then searches for its neighbours within a given threshold to identify and remove outliers. The new algorithm was tested with 14 buildings from two datasets, where quality control measures showed significant improvement over standard RANSAC.