Added a more idiomatic example using dict that doesn't preserve word order - not sure if that is required from the example.