Update sample to accept multiple scaling points
modify sample to accept multiple points, fix bugs