added hw recursion