doubly and stack-without-memcpy updated