Removing unnecessary code;
Using fopen instead of std::ifstream;
Removing some memory leaks;