removed obsolete internal function copy_subvector in favor of direct use of slice