code refine :use PRINT macro to print debug info