add comments
fix layout
add JavaDoc to comments