adding 'code copy' version from PAB