Notebook code