Ordinal invariants of well quasi orders