added perimeter variable