dealt with fread return vals, fixed linker parameter order