Fixed typo and wrapped the example up so you can copy and paste the whole thing to try it