I think I have fixed all bugs.  I didn't realize that the second arguement in substring was up to but NOT including