implement the new parser logic and add new tests, reformated debug output