Critical bug fixed

Change formulas of calculating new coordinates of vertex