modified write_text() and from_text() in materials.cpp
modified materials.cpp