add comments and jsperf test