scaled particles on terrain; code cleanup