modified FileParser class to work with files