fix out of range

if you start at i-1 then your first iteration will start the substring at -1, this kills the substring
Merge pull request #1 from TeaJizzle/patch-1

fix out of range