add docs,fixed some adaption issues