refactored by removing helper function for underlining and doing it in a more pythonic way