public void addGesture(String id, Gesture g, boolean addtoDB) {
    // verify if the gesture ID exits
    if (myGestureMap.containsKey(id)) {
      myGestureMap.get(id).add(g);
    } else {
      ArrayList<Gesture> gl = new ArrayList<Gesture>(10);
      gl.add(g);
      myGestureMap.put(id, gl);
    }

    if (DEBUG) {
      Log.i("addGesture", "attempting to insert to database");
    }

    myDBAdapter.insertGestureToDB(g);

    if (DEBUG) {
      this.printInfo("addGesture");
    }
  }