Cleaned up the fold tree method.