some code modification, and docment edits