Added documents deriving how code works