add comments
move to tools as 3rd party lib
add comments and reformat
add comments and reformat