cleaned up debug to make it simpler