added better debug statements