added regenerate procedure