Added drop-down menu for selecting calculation type. Removed switch
statement for compatibility with strings.