// returns true if array contains val, false otherwise
Array.prototype.contains = function(val) { 
  var x = 0;
  for (x=0; x<this.length; x++)
    if (this[x] == val)
      return true;

  return false;
};

// returns true if items was removed, false otherwise
Array.prototype.removeItem = function(val) {
  var found = false;

  for (x=0; x<this.length; x++) {
    if (found)
      this[x-1] = this[x];
    if (this[x] == val)
      found = true;
  }

  if (found == 1) {
    this.length--;
    return true;
  }
  return false;
};
