Added NMAS function with perimeter suppression