added comments to recursion