updated notebook optimization