Fix two typos, add exact edge calculation.

The edge calculation formula should be checked.