First stage of localization