fread is now working, but reading twice for some reaason