def METHOD_NAME( self, bean, newState ) :
    # sort out states      
    print "from Bean", bean
    print "with state", newState
    # JSON, if set to True
    if PUBLISHJSON :
        data = {}
        if ( not bean.getInverted( ) ) :
            if ( newState & jmri.Turnout.CLOSED ) :
                data['state'] = "CLOSED"                
            else:
                data['state'] = "THROWN"
        else :
            if ( newState & jmri.Turnout.CLOSED ) :
                data['state'] = "THROWN"                
            else:
                data['state'] = "CLOSED"
        json_data = json.dumps( data )
        return json_data
    # Without JSON - this is the same as the default behavior, here so you can modify it as desired
    else:
        if ( not bean.getInverted( ) ) :
            if  ( newState & jmri.Turnout.CLOSED ) :
                return "CLOSED"
            else :
                return "THROWN"
        else :
            if  ( newState & jmri.Turnout.CLOSED ) :
                return "THROWN"
            else :
                return "CLOSED"