New fucntion to show debug messages. Also applied it