changed the way things are read by using unformatted input