use index and substr to extract strings and comments, worked