* adding debug flag and debug printing