code documentation and formatting