fixed bug in removing useless points