public int lookup(PageId pageNo) {

    // Instantiate a new entry
    BufHTEntry entry;
    int index;

    // If the page does not exist return an INVALID_PAGE
    if (pageNo.pid == INVALID_PAGE)
      return INVALID_PAGE;

    // Determine which bucket in Page Table array that the pageNo would be in
    index = hash(pageNo);

    // Iterate through Page Table linked list searching for the pageNo specified
    // If found, return index in array, else return an INVALID_PAGE
    for (entry = ht[index]; entry != null; entry = entry.next) {
      if (entry.pageNo.pid == pageNo.pid) {
        return(entry.frameNo);
      }
    }

    // pageNo was not in the Page Table
    return(INVALID_PAGE);

  } // end lookup()