Added algorithm for identifying orphaned shapes when pieces are removed.