Thanks Deepak RaiShinichiro MurakamiMahfooj Khan for the useful tips and it seems to be working. However, when I'm working on the original dataset there are some odd examples that do not fit the rule. I'll circle back with those examples. Hope you can shed some light on how to fix those.

And Shinichiro Murakami - thanks so much for the step by step. It really helped a novice like me learn more out LODs.