Started tutorial, sorting out top-level functions