rearanged parser, now checks for start point <= end point