Realized that the length should be D/2 instead of D which solves the problem