ConfigRemoveVar <- function(configuration, var_type, var_entry) {
  if (var_type == '2d') {
    if (var_entry %in% configuration$two_d) {
      configuration$two_d <- configuration$two_d[- match(var_entry, configuration$two_d)]
    }
  } else if (var_type == 'mean') {
    if (var_entry %in% configuration$global_mean) {
      configuration$global_mean <- configuration$global_mean[- match(var_entry, configuration$global_mean)]
    }
  } else {
    stop("'var_type' must be either '2d' or 'mean'")
  }
  
  configuration
}
