Adding Imperative Programming To The Pattern Calculus