fixed layout and added more debug messages
added more tests for update and relate
fixed up test failures, added extra tests