contract ERC20 is ERC20Interface {

    // Link the SafeMath library
    using SafeMath for uint;

    // declare the storage
    mapping(address => mapping(address => uint)) private _allowance;
    mapping(address => uint) internal _balanceOf;

    uint internal _totalSupply;

    uint8 public constant decimals = 18;

    function _transfer(address from, address to, uint tokens) private returns (bool success) {
        _balanceOf[from] = _balanceOf[from].sub(tokens);
        _balanceOf[to] = _balanceOf[to].add(tokens);

        success = true;

        emit Transfer(from, to, tokens);
    }

    // Getters
    function totalSupply() public view returns (uint) {
        return _totalSupply;
    }

    function balanceOf(address tokenOwner) public view returns (uint balance) {
        balance = _balanceOf[tokenOwner];
    }

    function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
        remaining = _allowance[tokenOwner][spender];
        return remaining;
    }

    // Write the State
    function transfer(address to, uint tokens) public returns (bool success) {
        success = _transfer(msg.sender, to, tokens);
    }

    function approve(address spender, uint tokens) public returns (bool success) {
        _allowance[msg.sender][spender] = tokens;

        success = true;

        emit Approval(msg.sender, spender, tokens);
    }

    function transferFrom(address from, address to, uint tokens) public returns (bool success) {
        _allowance[from][msg.sender] = _allowance[from][msg.sender].sub(tokens);

        success = _transfer(from, to, tokens);
    }

}
function transfer(address to, uint tokens) public returns (bool success) {
    success = _transfer(msg.sender, to, tokens);
}

// Write the State