changed bitwise shit , confusing the recursion for the main driver