Added `--needed` functionality - closes #240