rewriting somt test programs