A completed flask tutorial with structural changes