added needed import statements and pickle export