Working code on hadoop cluster