fix up doc and style
fix style warnings
add more docs