enhanced copyfrom()