Added code finding stable regions