code simplification, add comment
remove non-used variables