added algorithm for removing overlapping surfaces