this works perfectly and your program produces the correct answer. If you feel like another challenge, perhaps this problem could also be solved using the String.prototype split() method. Anyways, great job on this.