Replaced the fun variable initialization with a dictionary