Added fwrite and fseek