small changes to final.c