licence and recursion fix