rewritten lot comments, add optimization to resize method.
bugfix: support calculation without boundary
rewrite some comments. run jsformat