Aligned code with example in Cookbook.