Rewrite of zone resetting code