refactored morse-to-string conversion method to string input instead of list