def FTHBTaxCredit(MARS, FTHB_credit, FTHB_credit_c, c00100,
                  FTHB_credit_e, fthbc, fthb_credit_amt):
    """
    Computes refundable first time homebuyers' tax credit amount.
    """
    if FTHB_credit is True:
        # max credit
        fthbc = max(0., min(FTHB_credit_c, fthb_credit_amt))
        # eliminated based on agi
        positiveagiamt = max(c00100, 0.)
        fthb_max_agi = FTHB_credit_e[MARS - 1]
        if positiveagiamt <= fthb_max_agi:
            fthbc = fthbc
        else:
            fthbc = 0.
    return (fthbc)