added subsampling parameter to copy functions