New dialog code rewrite

Trying a different approach to include event state