Function "dispatch" should not be virtual.
Added the original scope of functions so variables can be resolved.