logging changes, some bugs fixed