added class to handle file io