Added debug functiom