def transform_variables(problem, variables):
    """helper function for transforming platypus variables"""
    converted_vars = []
    for type, var in zip(problem.types, variables):
        var = type.decode(var)
        try:
            var = var[0]
        except TypeError:
            pass
        converted_vars.append(var)
    return converted_vars
