updates to stat.c