added debug mode + many parsing enhancements