revised dep-gathering script