Add missing code comments and update code documentation