reading from a typed file