removed debug code and add documentation remarks