Started work to detect perimeter closure. Previous 2 commits were Diogo's, not Alessandro's.