improved functionality for finding orphans. still need to create file for them.