Add the gain handling.
Use an enum rather than a string for the function.