The statistical theory of multi-step compound and direct reactions