ADDING DEBUG CODE