Added code for find orphans