added debug and diffing code
renaming