Revamped pruning scheme. Iterates until all pruning is done.
Use fill_footprint. Removed re-assigning idx.