Im looking for a method of reducing a quadratic Q(x,y,z)

The example I have is Q(x,y,z) = 4x^2 + 14y^2 + 5z^2 + 16xy - 8xz - 20yz

I know the answer is: Q(x,y,z) = 4(x + 2y - z)^2 - 2y^2 + z^2 - 4yz

= 4(x + 2y - z)^2 - 2(y + z) + 3z^2

any advice would be greatly appreciated.