implementing a class to handle the files