added codes to test

Tested on hadoop. But it's not behaving like expected.