fix document starting with empty line handling
added code token handling
fix some conflicts
removed useless lines
indenting