add comments and format the code

Signed-off-by: sunus <sunuslee@gmail.com>