Redone da7.cpp for working with files