add some debug funcs
move debug funcs to debug.go