begin writing of unpublish task, rename some functions
slight modifications