monkey onTree variable implemented with correct functionality