codes write to run on hadoop