fixed algorithm to not ignore sentences