Changed to filenumer type of fprintf