add some comment for code
move local variables to let