function setReferralCode(bytes32 _code) public returns (bytes32) {
        require(_code != "");
        require(refCodeOwners[_code] == address(0));
        require(oldContract.referralCodeOwners(_code) == address(0));
        require(userReferralCodes(msg.sender) == "");
        userRefCodes[msg.sender] = _code;
        refCodeOwners[_code] = msg.sender;
        return _code;
    }