adding macro to find outer profile