moved filename to class level as self.filename