added flag for debug printing