Replaced the old seperate function call with a wrapper function around the debug class.