restructured for better compatibility with interactive tutorial