got recursion to compile, but doesn't work correctly yet