update comments
add debugging output