Modified logic of light tree
Optimized logic for random cone scan