Added debugging function with macro