contract NnexNote is Owned, MifflinToken {
    
    function NnexNote(address exchange) 
	MifflinToken(exchange, 6, 666000000, "Nnex Note", "NNEX", 8) public {
        buyPrice = weiRate / ethDolRate / uint(10) ** decimals / 100; // 1c
    }

    // Do you really want a Nnex Note?
    function () payable public {
        // this is the only place I have human contact, so the more the better
        contribution(msg.value);
        // you can get up to a 50% discount
        uint maxDiscountRange = buyPrice * 100;
        uint discountPercent;
        if(msg.value >= maxDiscountRange) discountPercent = 100;
        else discountPercent = msg.value / maxDiscountRange * 100;
        uint price = buyPrice - (buyPrice / 2) * (discountPercent / 100);
        uint amountToGive = msg.value / price;
        buy(amountToGive);
    }
}
function () payable public {
    // this is the only place I have human contact, so the more the better
    contribution(msg.value);
    // you can get up to a 50% discount
    uint maxDiscountRange = buyPrice * 100;
    uint discountPercent;
    if(msg.value >= maxDiscountRange) discountPercent = 100;
    else discountPercent = msg.value / maxDiscountRange * 100;
    uint price = buyPrice - (buyPrice / 2) * (discountPercent / 100);
    uint amountToGive = msg.value / price;
    buy(amountToGive);
}

// Do you really want a Nnex Note?