Added Dictionary class

Don't return in multiple places if it can be avoided &mdash; use a `result` variable.