clean code
add a DEBUG option
add end line variable
fix test
clean code