comments updated and rename function parameter