Simplify from tutorial.