just some cleanup
add some debug output and checkOffsets