added initfrom copy-like function