Jerjer's code in William's notebook.