Derivation of a third-order Stokes wave theory