adding debug parameter for displaying debugging information