Added comments to recursive functions