code for ex9