Modified file reading for Model constructor