script for recursive hadd