Add the comment

Add explanation to code and reduce the for-loop max of counter.