Added Doc + solved a  minor bug