Converted my algorithm to the ITreeDetectionAlgorithm format