add doc
add docs, combine some functions