Added local variable declarations and writes.