Replaced += on some strings
Declared `var i`in for loops rather than just using `i`
Fixed left over nest if, changed to else if
Switched to `===` for string to string comparisons
Unfurled ternary operator deuglification missed
...Applied suggestions from code review...