#4 : perimeter operation sml version