reformated code, added hadoopy stuff