fixed al the bugs, recursion works