packrec.c: updated. make record a function; add some comments