cleanup and comments
add comments and TODO