calcCorners