added fstream to the tool