change structure, add recursion stuff