changed wrapPositions to capPositions