aded missing code documentation + minor style corrections