add code explanation to docs