add docs for complete code