update doc
update UI
update doc
extract function to calculate 2d dist