Added a version based on a dictionary