add debug functions
debug some more