better memory management in sign.c