refactored/cleaned code, updated comments
improved closing tag tests