next round of review + a number of TODO comments

Change-Id: I5639a8896156b369c9e82759f29d8eaaf474bb46
remove unused function

Change-Id: I1f06e47d2dd56a9c9a23716cf91abd3d00167492
use size_t for STL index

Change-Id: Id0582d5c6745a44f1a5142458654f7acb9fabe8d
first round int to bool

Change-Id: I01126ea293c6880bbf53cbc912d54fe8a9842e31