Debugged readFromFile and trim