finishing obstacle finding function