v4.01 added inline docs and fix some issues