added MinPerimRect