a=d^2-2d