converted printf into debug statement