Documentation and some code update