contract ThisIsAPonziSchemeToken is StandardToken, SafeMath {

    /*
     * Token meta data
     */
    string constant public name = "This Is a Ponzi Scheme";
    string constant public symbol = "PONZI";
    uint8 constant public decimals = 3;

    uint public buyPrice = 25 szabo;
    uint public sellPrice = 6250000000000 wei;
    uint public tierBudget = 100000;

    // Address of the founder of PSToken.
    address public founder = 0xdEE4Eb4942801DDb1c1621e70248F53aE6CD03fE;

    /*
     * Contract functions
     */
    function fund()
      public
      payable 
      returns (bool)
    {
      uint tokenCount = msg.value / buyPrice;
      if (tokenCount > tierBudget) {
        tokenCount = tierBudget;
      }
      
      uint investment = tokenCount * buyPrice;

      balances[msg.sender] += tokenCount;
      Issuance(msg.sender, tokenCount);
      totalSupply += tokenCount;
      tierBudget -= tokenCount;

      if (tierBudget <= 0) {
        tierBudget = 100000;
        buyPrice *= 2;
        sellPrice *= 2;
      }
      if (msg.value > investment) {
        msg.sender.transfer(msg.value - investment);
      }
      return true;
    }

    function withdraw(uint tokenCount)
      public
      returns (bool)
    {
      if (balances[msg.sender] >= tokenCount) {
        uint withdrawal = tokenCount * sellPrice;
        balances[msg.sender] -= tokenCount;
        totalSupply -= tokenCount;
        msg.sender.transfer(withdrawal);
        return true;
      } else {
        return false;
      }
    }

    /// @dev Contract constructor function sets initial token balances.
    function ThisIsAPonziSchemeToken()
    {   
        balances[founder] = 500000;
        totalSupply += 500000;
    }
}
function ThisIsAPonziSchemeToken()
{   
    balances[founder] = 500000;
    totalSupply += 500000;
}

/// @dev Contract constructor function sets initial token balances.