fix comments and bugs