I accidentally was defining substring-4 twice, and it screwed a LOT of stuff up