new function added to calculate the snappoints, is not yet implemented.