doc update.
doc update.
doc update.
small refactoring.
reordering functions.
reordering doc.