improved debug mode output