working on compare methods
modified substring to handle out of bounds properly
substring update