Made debug only print if debug boolean was true