bug fix in createLayerPoints