partial edit of htup.c