Replaced c-style file reading with std::ifstream
* there is no reason for performing system-calls instead of using the features offered by the standard library in this situation