added debug option, build/test with -tags debug to activate