anchor.diff:      // keep the call log info.
       var syncDoc;
       // Get an access token for the client, passing a device ID, only one device ID
  -    $.getJSON('/token', {
  +    $.getJSON('/token',
  +    {
         // Device ID is hardcoded in but can be auto generated with the below function
         // getDeviceId.
         device: 'test1234'
  -    }, function(tokenResponse) {
  +    }, function(tokenResponse)
  +    {
         // Initialize the Sync client
         accessManager = new Twilio.AccessManager(tokenResponse.token);
         syncClient = new Twilio.Sync.Client(accessManager);
   
         // Create and/or open a Sync document
  -      syncClient.document('TwilioChannel').then(function(doc) {
  -        doc.on("updated", function(data) {
  +      syncClient.document('TwilioChannel').then(function(doc)
  +      {
  +        doc.on("updated", function(data)
  +        {
             syncDoc = doc;
             data = syncDoc.get();
             buildCaller(callerProfile, data);
  
positive.code:     }
  
      // Parsing the JSON response into individual variables
      function buildCaller(caller, data) {
        caller.name = data.results.whitepages_pro_caller_id.result.results[0].belongs_to[0].names[0].first_name
          + " " + data.results.whitepages_pro_caller_id.result.results[0].belongs_to[0].names[0].last_name;
        caller.number = data.results.whitepages_pro_caller_id.result.results[0].phone_number;
        caller.phonetype = data.results.whitepages_pro_caller_id.result.results[0].line_type;
        caller.carrier = data.results.whitepages_pro_caller_id.result.results[0].carrier;
  
negative.code:     Twilio.Device.setup("<%= token %>", {debug: false});
  
      // Let us know when the client is ready.
      Twilio.Device.ready(function (device)
      {
        $("#log").text("Ready");
      });
  
      // Report an errors on the screen.
      Twilio.Device.error(function (error)
      {
        $("#log").text("Error: " + error.message);
      });
  
      // Estabilish a connection with the call.
      Twilio.Device.connect(function (conn)
      {
        $("#log").text("On call with: " + callerProfile.name);
      });
  
      // Message when a call disconnects
      Twilio.Device.disconnect(function (conn)
      {
        $("#log").text("Call ended");
        $(".script-template-container").hide();
      });
  
      Twilio.Device.cancel(function (conn)
      {
        $("#log").text("Call missed");
        $(".script-template-container").hide();
      });
  
      // Listens for incoming connections
      Twilio.Device.incoming(function (conn)
      {
          // set the globalConn
        globalConn = conn;
  
        syncClient.document('TwilioChannel').then(function(doc)
        {
          doc.on("updated", function(data)
          {
            syncDoc = doc;
            data = syncDoc.get();
            buildCaller(callerProfile, data);
          });
        });
        // Show the caller id info
        $("#log").text("Call from: " + callerProfile.name);
        showCaller(callerProfile);
        // Add to call log
        $("<li>", {id: conn.Id, text: callerProfile.name}).click(function ()
        {
          showCaller(callerProfile);
        }).prependTo("#people");
      });
  
      function showCaller (data)
      {
          var source   = $("#template").html();
          var template = Handlebars.compile(source);
          var context = data;
          var html    = template(context);
          $(".script-template-container").html(html);
          $(".script-template-container").show();
          $("#calllog").click( function()
          {
              $(".script-template-container").hide();
          });
      }
  
      function hideCaller ()
      {
          $(".script-template-container").hide();
      }
  
      function answer()
      {
          // answer the call
        globalConn.accept();
      }
  
      function hangup()
      {
        Twilio.Device.disconnectAll();
      }
  
      function addcaller()
      {
      }
  
      //Generate random UUID to identify this browser tab
      //For a more robust solution consider a library like
      //fingerprintjs2: https://github.com/Valve/fingerprintjs2
      // ****Currently not being used.****
      function getDeviceId()
      {
        return 'browser-' +
          'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
            var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
  