def write_csv(df, filename, rounding=2):
    """
    Writes a CSV file on to the disk from the computed design matrix
    filename: To be specified by the user. Just a name is fine. .CSV extension will be added automatically.
    rounding: Number up to which decimal the output will be rounded off. Often needed for practical DOE plans.
    """
    df_copy = round(df, rounding)
    try:
        if '.csv' not in filename:
            filename = filename + '.csv'
        f = df_copy.to_csv(filename, index=False)
        return f
    except:
        return -1
