Added debug functions