added distortion input to adjust the maximum size change for a cell