finished file reading and writing methods
improved logging
fixed bug in sortfactory class: using lexical class for local type as well