add more docs, moving docs in .h into .c