rewrite
updated documents
improved blank-line, tab handling
fixed bug that the last line is iterated twice