Added some debug functions