add better split-string and header parsing
add better debugging