I'm just gonna... put this here.....
1) changed output method from string concatenation to simply dumping ot
printwriter

2) changed nested loops for AMO clauses to get rid of redundant clauses

3) cleaned up imports and unused variables