Rename varName to key
Rename varName. Add cases for text started from \n. Added case for list
lines with excess comma on end
Remove comma at the end function. Little refactoring