add docs and diagram