removed character at index function as its not being used