refeactored recursion fixed all the bugs so much performance much wow