notebook (terminal) function