Use ifstream instead of manually making our own stream
Change fstream to fopen