def update_fsf(fsf, fsf_dict):
    """ update fsf with subject specific data
    Parameters
    ----------
    fsf : filename
        filename of default fsf file with default parameters
        to use for your model
    fsf_dict : dict
        dictionary holding data with the following keys:
        nuisance_dir
        nuisance_outdir
        input_data
        TR
        nTR

    Returns
    -------
    tmp5 : string
        string to write to new fsf file
    """
    original = open(fsf).read()
    tmp1 = original.replace('nuisance_dir',
        fsf_dict['nuisance_dir'])
    tmp2 = tmp1.replace('nuisance_model_outputdir',
        fsf_dict['nuisance_outdir'])
    tmp3 = tmp2.replace('nuisance_model_input_data',
        fsf_dict['input_data'])
    tmp4 = tmp3.replace('nuisance_model_TR',
        fsf_dict['TR'])
    tmp5 = tmp4.replace('nuisance_model_numTRs',
        fsf_dict['nTR'])
    return tmp5