Added input sequence in substring subroutine