finished inner function implementation