improved debug printing