summary.GARCHX <- function(object, ...) {
  p <- object$order[1]
  q <- object$order[2]
  covariates <- object$covariates
  sig_levels <- rep("", length(object$p.values))
  sig_levels[object$p.values <= 0.1] <- "."
  sig_levels[object$p.values <= 0.05] <- "*"
  sig_levels[object$p.values<= 0.01] <- "**"
  sig_levels[object$p.values <= 0.001] <- "***"
  
  cat("GARCHX Model Summary:\n\n")
  
  #cat("\nGARCH Component is GARCH(",p,", ",q,")\n\n", sep="")

  cat("GARCH Coefficients:\n")
  alpha_names <- rep("alpha", p)
  for (i in 1:p){
    alpha_names[i] <- paste("alpha_", i, sep="")
  }
  if (q > 0) {
    beta_names <- rep("beta", q)
    for (i in 1:q){
      beta_names[i] <- paste("beta_", i, sep="")
    }
    name <- c("omega", alpha_names, beta_names)
    value = c(object$omega, object$alpha, object$beta)
  } else {
    name <- c("omega", alpha_names)
    value = c(object$omega, object$alpha)
  }

  GARCH_parameter_df <- data.frame(
    name = name,
    value = value,
    pvalue = object$p.values[1:(1+p+q)],
    siglevel = sig_levels[1:(1+p+q)]
  )
  colnames(GARCH_parameter_df)[ncol(GARCH_parameter_df)] <- ""
  print(GARCH_parameter_df, row.names=FALSE)

  if (object$d > 0) ## there are covariates
  {
  
    cat("\nExogenous Covariates Coefficients:\n")
    gamma_names <- rep("gamma", length(object$gamma))
    for (i in 1:length(object$gamma)){
      gamma_names[i] <- paste("gamma_", covariates[i], sep="")
    }
    Data_coefficient_df <- data.frame(
      name = gamma_names,
      value = object$gamma,
      pvalue = object$p.values[(1+p+q+1):length(object$p.values)],
      siglevel = sig_levels[(1+p+q+1):length(sig_levels)]
    )  
    colnames(Data_coefficient_df)[ncol(Data_coefficient_df)] <- ""
    print(Data_coefficient_df, row.names=FALSE)  
  }
  cat("---\n")
  cat("Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1\n")  
  
  
  cat("\nInformation Criteria:\n")
  cat("  AIC:", AIC(object),"\n")
  cat("  BIC:", BIC(object),"\n")

}