implemented string_compare,fixed array index misuse in the book