fixed getStartEndCount, edited some comments