handle case with one repeated point (the source of bug hopefully)