code improvement
add comments for the code