The "while (string.length != 0)" because I didn't realize that an empty string is falsey and I could have just used "while (string)" instead. I'll spend some time looking over the truth tables. 

I'll be submitting a pull request with an updated version tomorrow. Thanks for all the input!