optimization and improvements to the point placement algorithm.

TO DO: clean up