Added *System.out/err outputs for debug*
Removed *Old code, histograms*
Modified *Added code to optimize mem usage*