I’m working on this p5.js code. I need you to merge two programs together. I need the functionality from both programs merged into one. 
This is program 1: 

class Building {
  constructor(x, y, name, color) {
    this.x = x;
    this.y = y;
    this.width = 100;
    this.height = 100;
    this.color = color;
    this.name = name;
    this.dragging = false;
    this.offsetX = 0;
    this.offsetY = 0;
  }

  display() {
    fill(this.color);
    if (this.dragging) {
      this.x = mouseX + this.offsetX;
      this.y = mouseY + this.offsetY;
    }
    rect(this.x, this.y, this.width, this.height);
    fill(0);
    text(this.name, this.x + 5, this.y + 50);
  }

  contains(x, y) {
    return (
      x > this.x &&
      x < this.x + this.width &&
      y > this.y &&
      y < this.y + this.height
    );
  }
}

const colors = [“red”, “green”, “blue”, “yellow”];
const buildings = [];

function setup() {
  createCanvas(800, 1000);
  textSize(36);

  for (const [i, building] of exampleData[“building/place”].entries()) {
    buildings.push(new Building(10 + i * 120, 500, building, colors[i]));
  }

  sentence = buildRandomSentence();
  background(220);
  displayText(sentence, 10, 400, 700);
}

function draw() {
  for (const building of buildings) {
    building.display();
  }
}

function mousePressed() {
  for (const building of buildings) {
    if (building.contains(mouseX, mouseY)) {
      building.dragging = true;
      building.offsetX = building.x - mouseX;
      building.offsetY = building.y - mouseY;
    }
  }
}

function mouseReleased() {
  for (const building of buildings) {
    building.dragging = false;
  }
}




This is program 2: 



// sentence models
const sentenceModels = [
    "The [building/place] is located on [Street Name].",
    "Turn [left/right] at the [building/place].",
    "Go straight for [number] blocks.",
    "The [building/place] is next to the [another building/place].",
    "The [building/place] is across the street from the [another building/place].",
    "The [building/place] is at the corner of [Street 1] and [Street 2].",
    "The [building/place] is behind the [another building/place].",
    "The [building/place] is close to the [another building/place].",
    "Take the [bus/train] to [Street Name] and then walk [direction].",
    "Can you tell me how to get to the [building/place]?"
  ];
  
  // example data for the placeholders
  const exampleData = {
    "building/place": ["library", "museum", "restaurant", "bank"],
    "Street Name": ["Main St", "First Ave", "Elm St", "Broadway"],
    "left/right": ["left", "right"],
    "number": [1, 2, 3, 4, 5],
    "another building/place": ["post office", "park", "movie theater", "school"],
    "Street 1": ["Maple St", "Oak St", "Pine St", "Sunset Blvd"],
    "Street 2": ["Second Ave", "Third Ave", "River Rd", "Fifth St"],
    "bus/train": ["bus", "train"],
    "direction": ["north", "south", "east", "west"]
  };
  
  let sentence;
class Building {
    constructor(x, y, name, color) {
      this.x = x;
      this.y = y;
      this.width = 100;
      this.height = 100;
      this.color = color;
      this.name = name;
      this.dragging = false;
      this.offsetX = 0;
      this.offsetY = 0;
    }
  
    display() {
      fill(this.color);
      if (this.dragging) {
        this.x = mouseX + this.offsetX;
        this.y = mouseY + this.offsetY;
      }
      rect(this.x, this.y, this.width, this.height);
      fill(0);
      text(this.name, this.x + 5, this.y + 50);
    }
  
    contains(x, y) {
      return (
        x > this.x &&
        x < this.x + this.width &&
        y > this.y &&
        y < this.y + this.height
      );
    }
  }
  
  const colors = ["red", "green", "blue", "yellow"];
  const buildings = [];
  
  function setup() {
    createCanvas(800, 1000);
    textSize(36);
  
    for (const [i, building] of exampleData["building/place"].entries()) {
      buildings.push(new Building(10 + i * 120, 500, building, colors[i]));
    }
  
    sentence = buildRandomSentence();
    background(220);
    displayText(sentence, 10, 400, 700);
  }
  
  function draw() {
    for (const building of buildings) {
      building.display();
    }
  }
  
  function mousePressed() {
    for (const building of buildings) {
      if (building.contains(mouseX, mouseY)) {
        building.dragging = true;
        building.offsetX = building.x - mouseX;
        building.offsetY = building.y - mouseY;
      }
    }
  }
  
  function mouseReleased() {
    for (const building of buildings) {
      building.dragging = false;
    }
  }
 

function draw() {}

function mouseClicked() {
    sentence = buildRandomSentence();
    background(220);
    displayText(sentence, 10, 400, 700);
}
  
function buildRandomSentence() {
    let model = random(sentenceModels);
    const regex = new RegExp(Object.keys(exampleData).join("|"), "g");
    return model.replace(regex, (match) => random(exampleData[match]));
}

function displayText(str, x, y, maxWidth) {
    const words = str.split(' ');
    let line = '';
    let posY = y;
  
    for (let n = 0; n < words.length; n++) {
        const testLine = line + words[n] + ' ';
        const testWidth = textWidth(testLine);
    
        if (testWidth > maxWidth && n > 0) {
            text(line, x, posY);
            line = words[n] + ' ';
            posY += textLeading();
        } else {
            line = testLine;
        }
    }
    text(line, x, posY);
}