making constructor from file