def advConstruct(expression, *args, constants={}):
    """Returns a function computing the given expression. The variable names need to be listed as individual string arguments.
    Constants is an optional argument with the name and value of constants in the expression"""
    string = """def func({}):
    return {}""".format(', '.join(args),
        expression.replace('^', '**'))
    exec(string, constants)
    return constants['func']
